<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

	<style type="text/css">
		.title{
			font-size:16px;
			font-weight:bold;
			padding:20px 10px;
			background:#eee;
			overflow:hidden;
			border-bottom:1px solid #ccc;
		}
		.t-list{
			padding:5px;
		}
	</style>

	<script type="text/javascript" charset="utf-8">
var admin_dagl_pp;
var admin_dagl_datagrid;
var admin_dagl_searchForm = undefined;
$(function(){
	
		admin_dagl_pp = $('#admin_dagl_pp').portal({
				border:false,
				fit:true
		});
		addPortal();
		
		admin_dagl_searchForm = $('#admin_dagl_searchForm').form();
	  $("#admin_da_searchButton").bind('click', function(){   
		  admin_da_search(); 
	   }); 
	  $("#admin_da_CleanSearchButton").bind('click', function(){   
		  admin_da_cleanSearch();
    	}); 
		
	  admin_dagl_datagrid=$('#admin_dagl_datagrid').datagrid({
		url : '${pageContext.request.contextPath}/daAction!dataGrid.action',
		fit : true,
		border : false,
		//animate : true,
		//singleSelect : false,	//false是打开全选功能
		striped:true,
		idField : 'id',
		rownumbers: true,		//显示行号
		fitColumns : false,		//显示横向滚动条
		pagination : true,
		pageSize : 15,
		pageList : [ 10,15, 20, 30, 40, 50 ],
		sortName:'cjsj',
		sortOrder:'desc',

		columns : [[{
					title:'编号',
					width:50,
					checkbox : true,
				},{
					title:'编号',
					field:'id',
					width:100,
					align : 'center',
					sortable:true,
					editor:{
						type:'text'
					}
				},{
					title : '箱柜编号',
					field : 'xgId',
					width : 80,
					align : 'center',
					sortable:true,

					editor:{
						type:'combobox',
						options:{
							required:true,
							valueField:'id',
							textField:'id',
							url:'${pageContext.request.contextPath}/xgAction!comboboxInfo.action',
							editable:true,
							missingMessage:'箱柜编号必填'
							
						}
					}
			
				},{
					title:'录入员',
					field:'addUserName',
					width:100,
					align : 'center',
					sortable:'true',
				},{
					title:'修改员',
					field:'editUserName',
					width:100,
					align : 'center',
					sortable:'true',
				},{
					title : '状态',
					field : 'ztList',
					width : 80,
					align : 'center',
					sortable:true,
					formatter:function(value){
						if(value){
							return value[0];
						}
					},
					editor:{
						type:'comboboxFk',
						options:{
							required:true,
							valueField:'id',
							textField:'zt',
							url:'${pageContext.request.contextPath}/ztAction!comboboxInfo.action',
							editable:false,
							missingMessage:'状态必填'
							
						}
					}
			
				},{
					title : '公司',
					field : 'gsmc',
					width : 80,
					align : 'center',
					sortable:true,
					editor:{
						type:'combobox',
						options:{
							valueField:'gs',
							textField:'gs',
							url:'${pageContext.request.contextPath}/gsAction!comboboxInfo.action',
							editable:false,
							
						}
					}
			
				},{
					title : '类别',
					field : 'lbmc',
					width : 80,
					align : 'center',
					sortable:true,
					editor:{
						type:'combobox',
						options:{
							valueField:'lb',
							textField:'lb',
							url:'${pageContext.request.contextPath}/lbAction!comboboxInfo.action',
							editable:false,
							
						}
					}
			
				},{
					title : '档案夹编号',
					field : 'ided',
					width : 80,
					align : 'center',
					sortable:true,

					editor:{
						type:'combobox',
						options:{
							valueField:'id',
							textField:'id',
							url:'${pageContext.request.contextPath}/daAction!comboboxInfo.action',
							editable:true,							
						}
					}
			
				},{
					title : '备注',
					field : 'bz',
					width : 130,
					align : 'center',
					sortable:true,
					editor:{
						type:'text'
					}
			
				},{
					title:'创建时间',
					field:'cjsj',
					width:100,
					sortable:true,
					editor:{
						type:'datetimebox',
						options:{
							editable:false,
						}
					}
				}]],
				 toolbar : [ {
				text : '增加',
				iconCls : 'icon-add',
				handler : function() {
					admin_da_appendColumns();
				}
			},'-', {
				text : '删除',
				iconCls : 'icon-remove',
				handler : function() {
					admin_da_del();
				}
			},'-',{
				text : '修改',
				iconCls : 'icon-edit',
				handler : function() {
					admin_da_edit();
				}
			},'-', {
				text : '保存',
				iconCls : 'icon-save',
				handler : function() {
					if (admin_da_editRow != undefined) {
						admin_da_datagrid.datagrid('endEdit', admin_da_editRow);
						admin_da_editRow = undefined;
					}
					if (admin_da_addRow != undefined) {
							var aaa=admin_da_datagrid.datagrid('endEdit', admin_da_addRow);
							admin_da_datagrid.datagrid('getChanges', 'inserted');
						
					}
				}
			}, '-', {
				text : '取消编辑',
				iconCls : 'icon-undo',
				handler : function() {
					admin_da_datagrid.datagrid('unselectAll');
					admin_da_datagrid.datagrid('rejectChanges');
					admin_da_editRow = undefined;
					admin_da_addRow = undefined;
				}
			}, '-', {
				text : '取消选中',
				iconCls : 'icon-undo',
				handler : function() {
					admin_da_datagrid.datagrid('unselectAll');
				}
			}, '-', {
				text : 'Excel导出',
				iconCls : 'icon-xz',
				handler : function() {
						
					admin_da_export_excel();
				}
			}, '-', {
				text : 'Excel导入模板',
				iconCls : 'icon-mb',
				handler : function() {
					admin_da_import_bm_excel();
				}
			}, '-', {
				text : 'Excel导入',
				iconCls : 'icon-xz',
				handler : function() {
					admin_da_import_excel();
				}
			}],
			});
			
		});
		
		
		function admin_da_search() {
			admin_dagl_datagrid.datagrid('load', serializeObject(admin_dagl_searchForm));
		}
		function admin_da_cleanSearch() {
			admin_dagl_datagrid.datagrid('load', {});
			admin_dagl_searchForm.find('input').val('');
		}

		function addPortal(){
			/*for(var i=0; i<3; i++){
				var p = $('<div/>').appendTo('body');
				p.panel({
					title:'Title'+i,
					content:'<div style="padding:5px;">Content'+(i+1)+'</div>',
					height:100,
					closable:true,
					collapsible:true
				});
				admin_dagl_pp.portal('add', {
					panel:p,
					columnIndex:i
				});
			}
			admin_dagl_pp.portal('resize');*/
		}
		function remove(){
			admin_dagl_pp.portal('remove',$('#pgrid'));
			admin_dagl_pp.portal('resize');
		}
</script>
</head>
<div id="admin_dagl_layout" class="easyui-layout" data-options="fit:true,border:false">
	<div region="north" class="title" border="false" style="height:50px;">
		档案信息调阅管理
	</div>
	<div region="center" border="false">
	
		<div id="admin_dagl_pp" style="position:relative">
			<div style="width:60%;">
				<div id="pgrid" title="查询" closable="true" style="height:100px;">
					<form id="admin_dagl_searchForm">
						<table class="admin_dagl_searchForm datagrid-toolbar" style="width: 100%;height: 100%;">
						<tr>
						<td>
						<label>档案编号:&nbsp;</label><input name="id" id="id" />
						</td>
						</tr>
						<td>
						<label>创建时间:&nbsp;</label><input name="startCjsj" id="startCjsj" editable="fasle" class="easyui-datetimebox"/>&nbsp;至&nbsp;<input name="endCjsj" id="endCjsj" editable="fasle" class="easyui-datetimebox"/>
						<a href='javascript:void(0);' id="admin_da_searchButton" class='easyui-linkbutton' data-options="iconCls:'icon-search'">查询</a>
						<a href='javascript:void(0);' id="admin_da_CleanSearchButton" class='easyui-linkbutton' data-options="iconCls:'icon-cancel'">清空</a>
						</td>
						</tr>
						</table>
					</form>
			    </div>
				<div id="pgrid" title="档案信息" closable="true" iconCls="icon-da"; collapsible="true" style="height:390px;">
					<table id="admin_dagl_datagrid"></table>
				</div>
			</div>
			<div style="width:40%;">
				<div id="pgrid" title="DataGrid" closable="true" style="height:200px;">
					1
			    </div>
			    <div title="Tutorials" collapsible="true" closable="true" style="height:200px;padding:5px;">
			    	2
			    </div>
			</div>
		</div>
	</div>
</div>